package com.ht.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ht.dto.TbDiagnoseOrder;
import com.ht.mapper.TbDiagnoseOrderMapper;
import com.ht.service.ITbDiagnoseOrderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 代齐园
 * @since 2022-05-25
 */
@Service
public class TbDiagnoseOrderServiceImpl extends ServiceImpl<TbDiagnoseOrderMapper, TbDiagnoseOrder> implements ITbDiagnoseOrderService {
    @Resource
    private TbDiagnoseOrderMapper orderMapper;
    @Override
    public List<TbDiagnoseOrder> getOrderStatus(Long id,String status) {
        QueryWrapper<TbDiagnoseOrder> queryWrapper = new QueryWrapper();
        queryWrapper.eq("status",status).eq("user_id",id);
        List<TbDiagnoseOrder> list = orderMapper.selectList(queryWrapper);
        return list;
    }

    @Override
    public List<TbDiagnoseOrder> getInvoiceStatus(Long id, String invoiceStatus) {
        QueryWrapper<TbDiagnoseOrder> queryWrapper = new QueryWrapper();
        queryWrapper.eq("invoice_status",invoiceStatus).eq("user_id",id);
        List<TbDiagnoseOrder> list = orderMapper.selectList(queryWrapper);
        return list;
    }
}
